<template lang="pug">
    skin(@up="up",@down="down",@yes="yes",@back="back",@duringUp="up",@duringDown="down")
        div(class="flex-column h3")
            div(class="flex-column-item")
              div(class="flex-row")
                div(class="flex-row-item flex-center-center flex-7") ----装药排气----
                div(class="flex-row-item right") {{activeId+1}}
            div(class="flex-column-item flex-3")
              div(class="flex-row")
                div(class="flex-row-item flex-5",style="height:100%")
                  div(class="flex-column")
                    div(class="flex-column-item flex-center flex-3",v-for="(menu,index) in currentPageMenus")
                      span(class="iconfont",:style="{'visibility': index == currentMenuIndex ? 'visible' : 'hidden'}") &#xe62c;
                      span {{menu.name}}
                div(class="flex-row-item",style="height:100%")
                  control-line(:total="this.menus.length",:current="activeId",style="float:right")

</template>

<script>
import MenuList from "@/mixins/MenuList";
export default {
  mixins: [MenuList],
  data() {
    return {
      page: { maxResultCount: 3, skipCount: 0 },
      visible: false
    };
  },
  computed: {
    menus() {
      const menus = [
        { name: "螺杆复位", id: 0, to: "lxReset" },
        { name: "推进-排气", id: 1, to: "exhaust" },
        { name: "日总量回顾", id: 4, to: "day-history" },
        { name: "排气回顾", id: 2, to: "exhaust-history" },
        { name: "报警回顾", id: 5, to: "warning-history" }
      ];
      return menus;
    },
    currentPageMenus() {
      var start = this.skipCount;
      var end = this.skipCount + this.page.maxResultCount;
      return this.menus.slice(start, end);
    }
  },
  methods: {
    up() {
      this.activeId --;
    },
    down() {
      this.activeId ++;
    },

    back() {
        this.$router.push("/menu?index=2");
    },
    yes() {
        if(this.currentMenu.id==1 && this.$route.query.lx == 'true'){
            this.$router.push('exhaust2'); // 螺杆复位后进行排气
        }else{
            this.$router.push(this.currentMenu.to);
        }
    }
  }
};
</script>

<style lang="less">
</style>
